﻿namespace BM.Tools.WebControls.MForm.Design.PropertiesGeneration
{
    using System;
    using System.ComponentModel;

    /// <summary>
    /// A definition class that keeps data about a property that can be generated from the MForm tree.
    /// </summary>
    public class PropertyDefinition
    {
        private bool enabled = true;

        /// <summary>
        /// Gets or sets the name of the property.
        /// </summary>
        public string Name
        {
            get; 
            set;
        }

        /// <summary>
        /// Gets or sets the xpath-like path to the control.
        /// </summary>
        public string Path
        {
            get; 
            set;
        }

        /// <summary>
        /// Gets or sets the type of the property.
        /// </summary>
        public Type ObjectType
        {
            get; 
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether the definition is enabled.
        /// </summary>
        [DefaultValue(true)]
        public bool Enabled
        {
            get
            {
                return enabled;
            }

            set
            {
                enabled = value;
            }
        }
    }
}
